import { ElMessage } from 'element-plus';
// 节流
let throttle = function (fn, wait) {
	var pre = Date.now();
	return function () {
		var context = this;
		var args = arguments;
		var now = Date.now();
		if (now - pre >= wait) {
			fn.apply(context, args);
			pre = Date.now();
		}
	};
};

let utils = {
	// 校验弹框
	toastI: throttle(function (title) {
		console.log(title);
		ElMessage(title);
	}, 1000),
};
export default utils;
